<?php

namespace Controller\Ajax;

class Category extends Base {

	public function delCategory() {
		$id = $this->getInt('id');
		if (!$id) {
			$this->responseError('参数错误');
		}
		$ids = \Data\Category::instance()->getIdsByPid($id);
		if ($ids) {
			\Data\Category::instance()
				->where(array('CategoryId in' => $ids))
				->del();
		}
		$this->response(true);
	}
}